package cn.gjculture.shopping.api.util;


import org.apache.commons.lang3.time.DateFormatUtils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {

    private static String timestamp="yyyy-MM-dd HH:mm:ss";
    private static String timeId="yyyyMMddHHmmss";

    public static long getTimestamp(){
        return new Date().getTime();
    }
    public static String getDate(Long times){
        return DateFormatUtils.format(times, timestamp);
    }

    public static void main(String[] args) throws ParseException {
        getTimestamp("ssss");
    }

    public static Long getTimestamp(String startPayTimeStr) throws ParseException {
        SimpleDateFormat formatter = new SimpleDateFormat(timestamp);
        return formatter.parse(startPayTimeStr).getTime();
    }




}
